Skip to content

build: hardened GCP Linux build lane (full Gecko + engine patches + scorecard)#42

Merged
mdheller merged 5 commits into
mainfrom
gcp-build-lane
Jun 21, 2026
Merged

build: hardened GCP Linux build lane (full Gecko + engine patches + scorecard)#42
mdheller merged 5 commits into
mainfrom
gcp-build-lane

Conversation

@mdheller

Copy link
Copy Markdown
Contributor

Two-part lane to compile BearBrowser from source on a GCP VM (the 8GB Mac can't — Gecko link needs 16GB+). Produces Linux binaries + the real fingerprint scorecard: the first actual compile-verification of the farble + OS-spoof patches.

  • gcp-remote-build.sh (on VM): apt deps + npm ci, then per profile apply-sourceos-overlays → make bootstrap → make build → measure-fingerprint. tor-mode asserts the compiled-in Windows identity.
  • gcp-build-linux.sh (orchestrator): teardown trap, free --dry-run, auth preflight, external-IP/IAP auto-detect, detached+polled build (SSH-drop safe), 150GB disk, artifact pull.

Tested offline (bash -n, 11M tarball with all key paths, graceful auth failure). Real run needs gcloud auth login first.

🤖 Generated with Claude Code

mdheller added 5 commits June 20, 2026 10:36
Adds a two-part lane to compile BearBrowser from source on a GCP VM — the
machine the 8GB Mac can't be (Gecko link needs 16GB+ RAM). Produces Linux
binaries + the real fingerprint scorecard (the first actual compile-verification
of the canvas/audio farble + OS-spoof patches).

  gcp-remote-build.sh : runs on the VM. apt deps + npm ci, then per profile:
    apply-sourceos-overlays -> make bootstrap (Mozilla toolchain) -> make build
    -> measure-fingerprint --bin. tor-mode asserts the Windows identity actually
    compiled in (the OS-spoof verification). Packages each dist; never aborts the
    other profile on a single failure.
  gcp-build-linux.sh : orchestrator. Hardened for first-time success:
    - teardown trap (a hung/failed build can never keep billing)
    - free --dry-run (validates auth + machine type + image, no VM)
    - auth preflight with exact 'gcloud auth login' instructions
    - auto-detects external-IP SSH vs --tunnel-through-iap (org-policy safe)
    - build runs DETACHED + polled via a status file, so a dropped SSH never
      kills the build or triggers an early teardown; 5h safety cap
    - 150GB SSD (two full obj trees fit), live progress, artifact pull

Tested offline: both pass bash -n; repo tarball is 11M with all key paths and
zero leaked build/node_modules/.git; --dry-run fails gracefully on expired auth.
Actual run needs 'gcloud auth login' first (token expired).
socioprophet-platform is locked down: outbound :22 blocked, OS Login org-
enforced, Workspace disables SSH-key registration, default compute SA missing.
SSH to build VMs is impossible. Rework the lane to use GCS + a startup script
instead — the VM builds autonomously and pushes results to a bucket; we poll.

- gcp-build-linux.sh: upload repo -> GCS, create VM with startup-script metadata
  + synapseiq-build SA (storage.admin), poll gs://.../DONE, download artifacts,
  teardown trap + --max-run-duration=DELETE cost cap. Free --dry-run validates
  auth/machine/image/bucket.
- gcp-vm-startup.sh: on the VM — install gcloud, pull repo, build as non-root
  'builder', push artifacts + DONE marker to GCS.
- gcp-remote-build.sh: per-profile overlay->bootstrap->build->measure (unchanged).

Verified: dry-run clean; first real launch compiles (serial console shows
overlay prep -> bootstrap in progress).
The msix.patch filter block was written but never committed — GCP builds
tar the git-tracked state so the fix was absent. Closes the tor-mode
build failure on FF140 ESR where msix.patch drifts and aborts make.
…o patch

mozilla::RandomUint64OrZero() was removed in Firefox 150 — only
RandomUint64OrDie() and RandomUint64() remain. The audio farble patch
adds code to nsRFPService.cpp that called the removed overload, causing
the human-secure build to fail at compile. Switch to RandomUint64()
with .valueOr(0) fallback (same behavior, correct API).
…efox

The compile succeeds but the build names the binary 'bearbrowser' (branded),
so the firefox-only finder reported 'no binary' and failed an otherwise-good
build. Match bearbrowser/librewolf/firefox; on miss, list dist/bin to debug.

Note: human-secure full Gecko compile with our canvas+audio engine patches is
now PROVEN ('Your build was successful!') — the audio RandomUint64 fix compiles.
@mdheller mdheller merged commit e7708e3 into main Jun 21, 2026
17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant